package com.example.aidl_loginresult;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;

import com.example.login.IListener;
import com.example.login.IPuduAidlInterface;

import androidx.annotation.Nullable;

public class LoginService extends Service {
    IListener listener;

    @Nullable
    @Override
    public IBinder onBind(final Intent intent) {
        return iBinder;
    }

    IBinder iBinder = new IPuduAidlInterface.Stub() {
        @Override
        public void registListener(IListener l) throws RemoteException {
            Log.e("LoginService", "addListener");
            listener = l;
        }

        @Override
        public void login() throws RemoteException {
            Log.e("LoginService", "logining1");

            listener.loginResult("login success");

        }

    };

}
